package com.learn.spring.ch2;

public class StandardOutMessageRenderer implements MessageRenderer {
	private MessageProvider provider=null;
	@Override
	public void render() {
		if(provider==null)
			throw new RuntimeException("Provider cannot be empty");
		System.out.println(provider.getMessage());
	}

	@Override
	public void setMessageProvider(MessageProvider provider) {
		this.provider=provider;

	}

	@Override
	public MessageProvider getMessageProvider() {
		
		return provider;
	}

}
